package com.github.m6d21.sso.support.validator.password;

/**
 *<p>
 *常量
 *</p>
 *
 * @author liuyang
 * @date 2018-12-06 Thu 23:48:10
 * @since 1.0.0
 */
@SuppressWarnings("all")
public class PasswordConstant {

    public static final String SIMPLE_REGEXP = "^(?![\\d]+$)(?![a-zA-Z]+$)[\\da-zA-Z]{6,12}$";
    public static final String GENERAL_REGEXP = "^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d)[\\da-zA-Z]{6,16}$";
    public static final String DIFFICULTY_REGEXP = "^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d)(?=.*[\\.!@#$%])[\\da-zA-Z\\.!@#$%]{6,16}$";
    public static final String SIMPLE_TIP = "密码必须是6-12位字母、数字组合，且分包含1个字母、1个数字";
    public static final String GENERAL_TIP = "密码必须是6-12位字母、数字组合，且至少包含1个大写字母、1个小写字母、1个数字";
    public static final String DIFFICULTY_TIP = "密码必须是6-12位字母、数字、特殊字符组合，且至少包含1个大写字母、1个小写字母、1个数字、1个特殊字符，特殊字符仅限仅限.!@#$%";

    public enum Type {
        /**
         * 简单
         */
        SIMPLE(SIMPLE_REGEXP, SIMPLE_TIP),
        /**
         * 一般
         */
        GENERAL(GENERAL_REGEXP, GENERAL_TIP),
        /**
         * 复杂
         */
        DIFFICULTY(DIFFICULTY_REGEXP, DIFFICULTY_TIP);

        private final String regexp;
        private final String tip;

        Type(final String regexp, final String tip) {
            this.regexp = regexp;
            this.tip = tip;
        }

        public String getRegexp() {
            return regexp;
        }

        public String getTip() {
            return tip;
        }
    }
}
